package com.bdzl.pojo;

import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * AgentUser entity. @author MyEclipse Persistence Tools3
 * 代理人用户
 */
@Entity
@Table(name = "agent_user")
@DynamicUpdate(true)
public class AgentUser  {
	// Fields

		private Integer id;
		private Agent agent;//代理人ID
		private Integer recognizeeId;//被保人/投保人ID
		private Long time;//添加时间
		private Integer state;//0删除 1正常
		private Integer type;//0被保人  1投保人

		// Constructors

		/** default constructor */
		public AgentUser() {
		}

		/** full constructor */
		public AgentUser(Agent agent, Integer recognizeeId, Long time,
				Integer state, Integer type) {
			this.agent = agent;
			this.recognizeeId = recognizeeId;
			this.time = time;
			this.state = state;
			this.type = type;
		}

		// Property accessors
		@Id
		@GeneratedValue(strategy = IDENTITY)
		@Column(name = "id", unique = true, nullable = false)
		public Integer getId() {
			return this.id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		@ManyToOne(fetch = FetchType.LAZY)
		@JoinColumn(name = "agent_id")
		public Agent getAgent() {
			return this.agent;
		}

		public void setAgent(Agent agent) {
			this.agent = agent;
		}

		@Column(name = "recognizee_id")
		public Integer getRecognizeeId() {
			return this.recognizeeId;
		}

		public void setRecognizeeId(Integer recognizeeId) {
			this.recognizeeId = recognizeeId;
		}

		@Column(name = "time")
		public Long getTime() {
			return this.time;
		}

		public void setTime(Long time) {
			this.time = time;
		}

		@Column(name = "state")
		public Integer getState() {
			return this.state;
		}

		public void setState(Integer state) {
			this.state = state;
		}

		@Column(name = "type")
		public Integer getType() {
			return this.type;
		}

		public void setType(Integer type) {
			this.type = type;
		}

}
